package tubesrus.filters;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class InterditFilter implements Filter {

	private FilterConfig config;
	
	public void destroy() {	}

	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		
		/*PrintWriter out = response.getWriter();
		
		out.println(
				"<!DOCTYPE html><html><head><meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>" +
				"<link type=text/css href=style.css rel=stylesheet><link rel=\"shortcut icon\" href=\"resources/images/favicon.jpg\" />" +
				"<title>TubesRus: Wrong way !</title></head><body>" +
				"<h1>Accès Interdit !</h1>" +
				"<p>Plutôt que de fureter, passez par la case \"Porte-Monnaie\" ;-)</p>" +
				"</body></html>"
		);*/
		chain.doFilter(request, response);
	}

	public void init(FilterConfig config) throws ServletException {
		this.config = config;
	}

}